<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match = "metadati">
		<xsl:variable name = "mio-eid" select = ".//eidentifier"/>
		<xsl:choose>
			<xsl:when test = "//metadati[.//erelation = $mio-eid][.//etype = 'revisione']"/>
			<xsl:otherwise>
				<xsl:call-template name = "ricopia"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<!--
		Ricopione
	-->
	<xsl:template name = "ricopia" match = "*">
		<xsl:element name = "{name()}">
			<xsl:copy-of select="@*"/>
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet>
